﻿using System;

namespace RedisService
{
    public class RedisFactory
    {
        private static IDatabase database;

        public static IDatabase DefaultRedis
        {
            get
            {
                if (database != null)
                {
                    return database;
                }
                else
                {
                    throw new Exception("默认Redis实现类为空！");
                }
            }
        }

        public static void RegRegisterDefaultRedis(IDatabase database)
        {
            RedisFactory.database = database;
        }
    }
}
